package com.github.xtranslation.core.dto;


import com.github.xtranslation.core.annotation.DictTrans;
import com.github.xtranslation.core.annotation.Trans;
import com.github.xtranslation.core.repository.SubjectTransRepository;
import com.github.xtranslation.core.repository.TeacherTransRepository;
import lombok.Data;

@Data
public class UserVO {

    private Long id;

    private String name;

    private String sex;

    private String job;

    private Long teacherId;

    // 关联查询后再用于被翻译的源数据ID
    @Trans(transKey = "teacherId", transField = "subjectId", repository = TeacherTransRepository.class)
    private Long subjectId;

    // 翻译字段=========================================================================================

    @DictTrans(transKey = "sex", group = "sexDict")
    private String sexName;

    // 翻译职业名称
    @DictTrans(transKey = "job", group = "jobDict")
    private String jobName;



    // 翻译班主任名称
    @Trans(transKey = "teacherId", transField = "name", repository = TeacherTransRepository.class)
    private String teacherName;

    // 翻译班主任所教学科
    @Trans(transKey = "subjectId", repository = SubjectTransRepository.class, transField = "name")
    private String subjectName;

    public UserVO(Long id, String name, Long teacherId, String sex, String job) {
        this.id = id;
        this.name = name;
        this.teacherId = teacherId;
        this.sex = sex;
        this.job = job;
    }
}
